<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>{{ title }}</title>
  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
  <nav class="navbar flex-column">
    <ul class="navbar nav-pills">
      {% for user_stat in summary %}
        <li class="nav-item">
          <a class="nav-link" id="{{ user_stat.account }}-link" href="#{{ user_stat.account }}-div">
            {{ user_stat.realname }}
          </a>
        </li>
      {% endfor %}
    </ul>
  </nav>
  {% for user_stat in summary %}
    <div id="{{ user_stat.account }}-div">
      <h2>{{ user_stat.realname }}({{ user_stat.account }}){{ title }}</h2>
      <div class="card">
        <div class="card-header">
          <a class="card-link" data-toggle="collapse" href="#bug-div">
            BUG
          </a>
        </div>
        <div id="bug-div" class="collapse show">
          <div class="card-body">
            <div id="bug-overview-div">
              <h6>期间操作BUG统计</h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th></th>
                  <th>致命</th>
                  <th>严重</th>
                  <th>一般</th>
                  <th>提示</th>
                  <th>合计</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                  <td>创建</td>
                  <td>{{ user_stat.bug.open.summary['致命'] }}</td>
                  <td>{{ user_stat.bug.open.summary['严重'] }}</td>
                  <td>{{ user_stat.bug.open.summary['一般'] }}</td>
                  <td>{{ user_stat.bug.open.summary['提示'] }}</td>
                  <td>{{ user_stat.bug.open.total }}</td>
                </tr>
                <tr>
                  <td>关闭</td>
                  <td>{{ user_stat.bug.close.summary['致命'] }}</td>
                  <td>{{ user_stat.bug.close.summary['严重'] }}</td>
                  <td>{{ user_stat.bug.close.summary['一般'] }}</td>
                  <td>{{ user_stat.bug.close.summary['提示'] }}</td>
                  <td>{{ user_stat.bug.close.total }}</td>
                </tr>
                <tr>
                  <td>激活</td>
                  <td>{{ user_stat.bug.active.summary['致命'] }}</td>
                  <td>{{ user_stat.bug.active.summary['严重'] }}</td>
                  <td>{{ user_stat.bug.active.summary['一般'] }}</td>
                  <td>{{ user_stat.bug.active.summary['提示'] }}</td>
                  <td>{{ user_stat.bug.active.total }}</td>
                </tr>
                <tr>
                  <td>解决</td>
                  <td>{{ user_stat.bug.resolve.summary['致命'] }}</td>
                  <td>{{ user_stat.bug.resolve.summary['严重'] }}</td>
                  <td>{{ user_stat.bug.resolve.summary['一般'] }}</td>
                  <td>{{ user_stat.bug.resolve.summary['提示'] }}</td>
                  <td>{{ user_stat.bug.resolve.total }}</td>
                </tr>
                <tr>
                  <td>当前待处理</td>
                  <td>{{ user_stat.bug.current.summary['致命'] }}</td>
                  <td>{{ user_stat.bug.current.summary['严重'] }}</td>
                  <td>{{ user_stat.bug.current.summary['一般'] }}</td>
                  <td>{{ user_stat.bug.current.summary['提示'] }}</td>
                  <td>{{ user_stat.bug.current.total }}</td>
                </tr>
                </tbody>
              </table>
            </div>
            <div id="bug-open-div">
              <h6>期间创建BUG详情</h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th>日期</th>
                  <th>严重程度</th>
                  <th>数量</th>
                  <th>详情</th>
                </tr>
                </thead>
                <tbody>
                {% for i in user_stat.bug.open.detail %}
                  <tr>
                    <td>{{ i[0] }}</td>
                    <td>{{ i[1] }}</td>
                    <td>{{ i[2] }}</td>
                    <td>{{ i[3] }}</td>
                  </tr>
                {% endfor %}
                </tbody>
              </table>
            </div>
            <div id="bug-close-div">
              <h6>期间关闭BUG详情</h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th>日期</th>
                  <th>严重程度</th>
                  <th>数量</th>
                  <th>详情</th>
                </tr>
                </thead>
                <tbody>
                {% for i in user_stat.bug.close.detail %}
                  <tr>
                    <td>{{ i[0] }}</td>
                    <td>{{ i[1] }}</td>
                    <td>{{ i[2] }}</td>
                    <td>{{ i[3] }}</td>
                  </tr>
                {% endfor %}
                </tbody>
              </table>
            </div>
            <div id="bug-active-div">
              <h6>期间激活BUG详情</h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th>日期</th>
                  <th>严重程度</th>
                  <th>数量</th>
                  <th>详情</th>
                </tr>
                </thead>
                <tbody>
                {% for i in user_stat.bug.active.detail %}
                  <tr>
                    <td>{{ i[0] }}</td>
                    <td>{{ i[1] }}</td>
                    <td>{{ i[2] }}</td>
                    <td>{{ i[3] }}</td>
                  </tr>
                {% endfor %}
                </tbody>
              </table>
            </div>
            <div id="bug-resolve-div">
              <h6>期间解决BUG详情</h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th>日期</th>
                  <th>严重程度</th>
                  <th>数量</th>
                  <th>详情</th>
                </tr>
                </thead>
                <tbody>
                {% for i in user_stat.bug.resolve.detail %}
                  <tr>
                    <td>{{ i[0] }}</td>
                    <td>{{ i[1] }}</td>
                    <td>{{ i[2] }}</td>
                    <td>{{ i[3] }}</td>
                  </tr>
                {% endfor %}
                </tbody>
              </table>
            </div>
            <div id="bug-current-div">
              <h6>当前待处理BUG详情</h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th>严重程度</th>
                  <th>数量</th>
                  <th>详情</th>
                </tr>
                </thead>
                <tbody>
                {% for i in user_stat.bug.current.detail %}
                  <tr>
                    <td>{{ i[0] }}</td>
                    <td>{{ i[1] }}</td>
                    <td>{{ i[2] }}</td>
                  </tr>
                {% endfor %}
                </tbody>
              </table>
            </div>

          </div>
        </div>
      </div>
      <div class="card">
        <div class="card-header">
          <a class="card-link" data-toggle="collapse" href="#task-div">
            任务
          </a>
        </div>
        <div id="task-div" class="collapse show">
          <div class="card-body">
            <div id="task-do-div">
              <h6>期间执行任务详情：所有任务共消耗{{ user_stat.task.do.total_consumed }}工时</h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th>日期</th>
                  <th>任务ID</th>
                  <th>名称</th>
                  <th>消耗工时</th>
                </tr>
                </thead>
                <tbody>
                {% for i in user_stat.task.do.detail %}
                  <tr>
                    <td>{{ i[0] }}</td>
                    <td>{{ i[1] }}</td>
                    <td>{{ i[2] }}</td>
                    <td>{{ i[3] }}</td>
                  </tr>
                {% endfor %}
                </tbody>
              </table>
            </div>
            <div id="task-current-div">
              <h6>当前待处理任务详情：共{{ user_stat.task.current.total }}条任务 </h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th>任务状态</th>
                  <th>数量</th>
                  <th>详情</th>
                </tr>
                </thead>
                <tbody>
                {% for i in user_stat.task.current.detail %}
                  <tr>
                    <td>{{ i[0] }}</td>
                    <td>{{ i[1] }}</td>
                    <td>{{ i[2] }}</td>
                  </tr>
                {% endfor %}
                </tbody>
              </table>
            </div>
            <div id="task-short-period-div">
              <h6>未来{{ user_stat.task.short_period.period }}天任务详情：预计工时{{ user_stat.task.short_period.summary.estimate }}，已消耗{{ user_stat.task.short_period.summary.consumed }}，剩余共{{ user_stat.task.short_period.summary.left }}(红色字体为超期任务) </h6>
              <table class="table table-striped table-sm">
                <thead>
                <tr>
                  <th>截止</th>
                  <th>任务ID</th>
                  <th>名称</th>
                  <th>状态</th>
                  <th>预计</th>
                  <th>消耗</th>
                  <th>剩余</th>
                </tr>
                </thead>
                <tbody>
                {% for i in user_stat.task.short_period.detail %}
                  <tr {% if i[0] and i[0]|string < user_stat.from_date %}style="color:red;"{% endif %}>
                    <td>{{ i[0] }}</td>
                    <td>{{ i[1] }}</td>
                    <td>{{ i[2] }}</td>
                    <td>{{ i[3] }}</td>
                    <td>{{ i[4] }}</td>
                    <td>{{ i[5] }}</td>
                    <td>{{ i[6] }}</td>
                  </tr>
                {% endfor %}
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  {% endfor %}
</div>
</body>
</html>